#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cmath>
using namespace std;

int main()
{
	for (int i = 100; i <= 999; i++)
	{
		int tmp = i;
		int sum = 0;
		while (tmp)
		{
			sum += pow(tmp % 10, 3);
			tmp /= 10;
		}
		if (sum == i)
		{
			cout << i << endl;
		}
	}
	return 0;
}